import { CouresEnum } from "@/enums/school/course.enum";
import type { TabelPropsType } from "./index.type";
import type { RequiredKeys } from "@/types/index.type";

export type TabelCardPropsType = {
  tabelData: TableDataType[];
  tableProps: TabelPropsType;
  onReset: Function;
};

export type TeacherType<T extends string = CouresEnum> = {
  [key in `${T}Teacher`]: string;
};

export type TableDataType<T extends string = CouresEnum> = {
  key: React.ReactNode;
  id: number;
  gradeAndClass: `${number}-${number}`;
  subject: 0 | 1 | 2; // 0-未分科 1-文科 2-理科
  classTeacher: string; // 班主任
  classTeacherId: number;
  createBy: string;
  createDate: string;
  updateBy: string;
  updateDate: string;
} & TeacherType<T>;

export type FormPropsType = {
  grade: 1 | 2 | 3;
  _class: number;
} & RequiredKeys<TableDataType, "subject" | "classTeacherId"> &
  TeacherType;
